<template>
  <div>
    <div>
      <div class="newshead">
        <div class="title-head" title="案例中心">案例中心</div>
      </div>
    </div>
    <div class="area">
      <div v-for="(item,index)  in caseList" :key="index">
        <van-card @click="casedeatil(item)" :desc="item.introduction" :title="item.title"
          :thumb="item.successtList[0].url" />
      </div>
    </div>
    <van-pagination @change='nextpage' v-model="currentPage" :total-items="total" :show-page-size="5" force-ellipses />
    <div class="footer">
      <div class="aboutme">
      </div>
      <van-divider />
      <div class="last">
        <a href="http://www.beian.miit.gov.cn">
          备案号：苏ICP备20041612号
        </a>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'PhoneCase',
  data () {
    return {
      caseList: [],
      total: 0,
      currentPage: 1
    }
  },
  methods: {
    getCase () {
      this.$axios({
        method: 'get',
        url: '/success/select?page=1&pageSize=5'
      }).then((res) => {
        if (res.status === 200) {
          this.caseList = res.data.data.rows
          this.total = res.data.data.records
        }
      })
    },
    nextpage (e) {
      this.$axios({
        method: 'get',
        url: '/success/select?page=' + e + '&pageSize=5'
      }).then((res) => {
        if (res.status === 200) {
          this.caseList = res.data.data.rows
          this.total = res.data.data.records
        }
      })
    },
    casedeatil (item) {
      this.$router.push({
        path: '/PhoneDeatil',
        query: {
          name: 'Case',
          id: item.id
        }
      })
    }
  },
  mounted () {
    this.getCase()
  }
}
</script>

<style scoped>
.van-card__desc,
.van-ellipsis {
  margin-top: 15px;
}
.van-card__title,
.van-multi-ellipsis--l2 {
  font-weight: 600;
  font-size: 14px;
  margin-top: 10px;
}
.van-card {
  background: white;
  border-bottom: #eeeeee 1px solid;
}
.newshead {
  width: 300px;
  height: 60px;
  background: rgb(15, 66, 155);
  color: white;
  font-size: 25px;
  text-align: center;
  overflow: hidden;
  margin: 15px auto;
  border-radius: 5px;
}
.area {
  min-height: 510px;
}
.title-head {
  line-height: 40px;
  margin: 10px 0;
  cursor: pointer;
}
.footer {
  text-align: center;
  background: #364a62;
  margin-bottom: 60px;
  overflow: hidden;
  margin-top: 15px;
}
.aboutme {
  margin-top: 10px;
  color: white;
  font-weight: 600;
}
.content {
  margin-top: 10px;
  text-align: center;
  font-weight: normal;
}
.last {
  height: 20px;
  line-height: 20px;
  color: white;
  margin-bottom: 16px;
}
a {
  text-decoration: none;
  color: white;
}
</style>
